//
//  AddShangHuHaoViewController.m
//  ShouKuang
//
//  Created by CodeYY on 2019/5/31.
//  Copyright © 2019 CodeYY. All rights reserved.
//

#import "AddShangHuHaoViewController.h"

@interface AddShangHuHaoViewController ()
@property (nonatomic, weak)UITextField *numTF;
@property (nonatomic, weak)UITextField *phoneTF;



@end

@implementation AddShangHuHaoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self initNavBar];
    [self initCustomUI];
    // Do any additional setup after loading the view.
}
-(void)initNavBar
{
    WEAKSELF
    UIButton *leftBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [leftBtn setImage:[UIImage imageNamed:@"nav_back_red"] forState:UIControlStateNormal];
    [leftBtn setTitle:@"返回" forState:UIControlStateNormal];
    [leftBtn setTitleColor:YYRGB(129, 129, 129) forState:UIControlStateNormal];
    [leftBtn jk_setImagePosition:LXMImagePositionLeft spacing:5];
    [[leftBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(id x) {
        [weakSelf.navigationController popViewControllerAnimated:YES];
    }];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:leftBtn];
    
    self.title = @"添加商户号";
    
}
- (void)initCustomUI
{
    UIView *contentView = [[UIView alloc] init];
    [self.view addSubview:contentView];
    contentView.backgroundColor = [UIColor whiteColor];
    [contentView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(70);
        make.left.right.offset(0);
        make.height.mas_equalTo(190);
    }];
    
    UITextField *numTF = [UITextField new];
    [contentView addSubview:numTF];
    _numTF = numTF;
    [numTF mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(40);
        make.left.offset(80);
        make.right.offset(-80);
    }];
    numTF.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请输入商户号" attributes:@{}];
    UIView *line = [UIView new];
    [numTF addSubview:line];
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.offset(0);
        make.bottom.offset(10);
        make.height.mas_equalTo(1);
    }];
    line.backgroundColor = [UIColor lightGrayColor];
    [[numTF rac_textSignal] subscribeNext:^(id x) {
        
    }];
    
    UITextField *phoneTF = [UITextField new];
    [contentView addSubview:phoneTF];
    _phoneTF = phoneTF;
    [phoneTF mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(numTF.mas_bottom).offset(40);
        make.left.right.equalTo(numTF);
    }];
    phoneTF.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请输入手机号" attributes:@{}];
    UIView *line1 = [UIView new];
    [phoneTF addSubview:line1];
    [line1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.offset(0);
        make.bottom.offset(10);
        make.height.mas_equalTo(1);
    }];
    line1.backgroundColor = [UIColor lightGrayColor];
    [[phoneTF rac_textSignal] subscribeNext:^(id x) {
        
    }];
    
    
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.view addSubview:btn];
    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.offset(0);
        make.top.equalTo(contentView.mas_bottom).offset(50);
        make.height.mas_equalTo(50);
    }];
    btn.backgroundColor = [UIColor whiteColor];
    [btn setTitle:@"继续" forState:UIControlStateNormal];
    [btn setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    [[btn rac_signalForControlEvents:UIControlEventTouchUpInside]subscribeNext:^(id x) {
        
    }];
    
}

@end
